package edu.ccut.saturn.workflow.parse;

import edu.ccut.saturn.component.IParameterContext;
import edu.ccut.saturn.workflow.model.WorkFlowInfo;

public class ParseWorkFlowXml extends ParseWorkFlow {
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		debug("start ParseWorkFlowXml",parameterContext);
		byte[] xml = (byte[]) parameterContext.getParameterValue(0);
		// 从数据库取出的byte[]数据不是UTF-8编码的，需要转码
		//xml = new String(xml, "UTF-8").getBytes("UTF-8");
		xml = new String(xml, "GBK").getBytes("UTF-8");
		WorkFlowInfo workflowInfo = parseXml(xml);
		parameterContext.setParameter(1, workflowInfo);
	}
}